package kr.saeildamil.androidstudy_second20.common;

import android.app.Fragment;
import android.graphics.Color;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;
import android.widget.TextView;

public class TextFragment extends Fragment {
	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		
		
		LinearLayout root=new LinearLayout(getActivity());
		root.setOrientation(LinearLayout.VERTICAL);
		root.setBackgroundColor(Color.GREEN);
		
		TextView tv=new TextView(getActivity());
		tv.setText("문자열 입력 프래그먼트");
		
		EditText edit=new EditText(getActivity());
		edit.setBackgroundColor(Color.RED);
		edit.setText("String");
		
		LayoutParams params=new LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);
		
		root.addView(tv, params);
		root.addView(edit, params);
		
		return super.onCreateView(inflater, container, savedInstanceState);
	}
}
